<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, user-scalable=no,
		initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/normalize.css"/>
		<link rel="stylesheet" type="text/css" href="./css/sign_in.css"/>
		<script src="js/flexible.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class="login container">
			<p style="text-align: center;font-size: 0.48rem;padding-top: 1.133333rem;color: white;">注册</p>
			<header>
				<img src="img/注册/logo@2x.png" >
			</header>
			<ul class="re">
				<li><label><img src="img/注册/姓名@2x.png" ></label><input type="text" name="" id="" value=""placeholder="昵称/真实姓名"/ ></li>
				<li><label><img src="img/注册/手机号@2x.png" ></label><input type="text" name="" id="" value="" placeholder="请输入注册手机号" /></li>
				<li class="getcode"><label><img src="img/注册/验证码@2x.png" ></label><input type="text" name="" id="" value="" placeholder="请输入短信验证码"/> <span id="getCode">请输入验证码</span></li>
				<li><label><img src="img/注册/密码@2x.png" ></label><input type="text" name="" id="" value=""placeholder="请设置6-20位登录密码" /></li>
			</ul>
			<div class="chosses"><img src="img/注册/选中@2x.png" ><span style="color: #FFFFFF;margin-left: 0.186666rem;">同意</span><span style="color: #007AFF;">《管家妈妈服务协议》</span></div>
			<button class="butten">立即注册</button>
		<p class="text">
			您通过扫描XX管家的邀请码进入该页面注册，填写信息即可完成注册。
		</p>
		</div>
	</body>
</html>
<script type="text/javascript">
	/* 
	 setTimeout(,2000)//延迟执行
	 setInterval(,3000)//每隔一段时间执行
	 */
	window.onload=function(){
		var flag=true
		document.getElementById("getCode").onclick=function(){
			if(flag){
				flag=false
				var num=4;
				var stopId=setInterval(()=>{
					if(num===0){
					this.innerText="获取验证码"
						clearInterval(stopId);
						flag = true;
						return false
					};
					
					num-=1;
					console.log(num);
					this.innerText=num<10?("0"+num):num
				},1000)
			}
		}
		
		
		/* var flag=true
		var getCode=document.getElementById("getCode")
		getCode.onclick=function(){
			if(flag){
				flag=false
				var num=11;
				var stopId=setInterval(function(){
					if(num===0){
					getCode.innerText="获取验证码"
						clearInterval(stopId)
						flag=true
						return false
					}
					num-=1
					getCode.innerText=num<10?("0"+num):num
				},1000)
			}
		} */	
		
	}

</script>
